﻿//-----------------------------------------------------------------
//
// @(#)$Id: EbayActiveListing.aspx.cs,v 1.0 2013/12/13 17:13:39 lichunhua Exp $
// @(#)$Author: lichunhua  $
// @(#)$Date: 2013/12/13 17:13:39 $
// @(#)$Description:
//
//
//
//                 All Rights Reserved.
//-----------------------------------------------------------------
using System;
using System.Data;
using System.Web.UI.WebControls;
using ebay.Dal;
using ebay.Dal.CenterDB_EbayTableAdapters;

public partial class UI_Bas_EbayActiveListing : System.Web.UI.Page
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        T_EbayAccountTableAdapter ebayAdapter = new T_EbayAccountTableAdapter();
        ddlebayUserId.DataSource = ebayAdapter.GetData();
        ddlebayUserId.DataTextField = "EbayUserId";
        ddlebayUserId.DataValueField = "EbayUserId";
        ddlebayUserId.DataBind();
        ddlebayUserId.Items.Insert(0, new ListItem("《--请选择--》", " "));


        ddlOnLineStatus.Items.Insert(0, new ListItem("《--请选择--》", ""));
        ddlOnLineStatus.Items.Insert(1, new ListItem("在线", "在线"));
        ddlOnLineStatus.Items.Insert(2, new ListItem("下线", "下线"));
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.CheckRight();
        if(!IsPostBack )
        {
        }
    }

    protected void btnExport_Click(object sender, EventArgs e)
    {
        string ebayUserId = ddlebayUserId.Value.Trim();
        string ItemId = txtItemId.Value.Trim();
        string ItemTitle = txtItemTitle.Value.Trim();
        string CustomLable = txtCustomLable.Value.Trim();
        string Listing = txtListing.Value.Trim();
        string OnLineStatus = ddlOnLineStatus.Value.Trim();
      
        Report ag = new Report();
        // DataTable table = ag.GetInventory();
        DataTable table = ag.GetActiveListing(ebayUserId, ItemId, ItemTitle, CustomLable, Listing, OnLineStatus);

        if (table != null)
        {
            DataSetToExcel.DataSetOutExcel(table, "ActiveListing");
        }
        else
        {
            WebUtility.ShowMsg("无数据", this);

        }
    }    
}
